package com.caiyi.financial.nirvana.sms.gateway;

import com.caiyi.financial.nirvana.sms.jedis.JedisKey;
import com.caiyi.financial.nirvana.sms.jedis.JedisService;
import com.caiyi.financial.nirvana.sms.subscribe.GatewaySubscribeListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 网关行为线程
 */
public class GatewayActionThread implements Runnable {

    private static final Logger logger = LoggerFactory.getLogger(GatewayActionThread.class);

    public GatewayActionThread() {
    }

    @Override
    public void run() {
        //订阅实现
        try {
            logger.info("GatewayActionThread starting !!! ");
            JedisService.subscribe(GatewaySubscribeListener.getInstance(), JedisKey.SMS_SUBSCRIBE_GATEWAY_ACTION);
        } catch (Exception e) {
            logger.error("GatewayActionThread error !!!", e);
        }
    }
}
